//
//  MyCollectionCell.m
//  WorkNest
//
//  Created by giantumbrella on 15/7/28.
//  Copyright (c) 2015年 nest. All rights reserved.
//

#import "MyCollectionCell.h"
#import "MyCollectionModel.h"

@interface MyCollectionCell ()
@property (nonatomic,strong) UIImageView *imgViewCollection;
@property (nonatomic,strong) UILabel *labelTitle;
@property (nonatomic,strong) UILabel *labelPrice;
@property (nonatomic,strong) UILabel *labelHotSale;
@property (nonatomic,strong) UILabel *labelAuthorID;
@end
@implementation MyCollectionCell

- (id)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        [self createSubViews];
//        self.backgroundColor = UIColorWithRGBA(246, 246, 246, 1);
    }
    return self;
}

- (void)createSubViews
{
      //图片
    self.imgViewCollection = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, (SCREEN_WIDTH-10)/2, 180)];
    [self addSubview:self.imgViewCollection];
    self.imgViewCollection.backgroundColor = [UIColor redColor];
    
    //题目
    self.labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, self.imgViewCollection.frame.size.height+self.imgViewCollection.frame.origin.y, SCREEN_WIDTH/2, 30)];
    [self addSubview:self.labelTitle];
    self.labelTitle.textColor = [UIUtil colorWithHexString:@"#757575"];
    self.labelTitle.font = [UIFont systemFontOfSize:13];
    
    //价钱
    self.labelPrice = [[UILabel alloc] initWithFrame:CGRectMake(0, self.labelTitle.frame.size.height+self.labelTitle.frame.origin.y, SCREEN_WIDTH/4, 30)];
    [self addSubview:self.labelPrice];
    self.labelPrice.textColor = [UIUtil colorWithHexString:@"#de53c2"];
    self.labelPrice.font = [UIFont systemFontOfSize:14];
    
    //量
    self.labelHotSale = [[UILabel alloc] initWithFrame:CGRectMake(self.labelTitle.frame.size.width/2, self.labelTitle.frame.size.height+self.labelTitle.frame.origin.y, SCREEN_WIDTH/4, 30)];
    [self addSubview:self.labelHotSale];
    self.labelHotSale.textColor = [UIUtil colorWithHexString:@"#b0b0b0"];
    self.labelHotSale.font = [UIFont systemFontOfSize:13];
    //ID
    self.labelAuthorID = [[UILabel alloc] initWithFrame:CGRectMake(0, self.labelHotSale.frame.size.height+self.labelHotSale.frame.origin.y, SCREEN_WIDTH/2, 30)];
    [self addSubview:self.labelAuthorID];
    self.labelAuthorID.textColor = [UIUtil colorWithHexString:@"#b0b0b0"];
    self.labelAuthorID.font = [UIFont systemFontOfSize:13];


}

- (void)layoutSubviews
{
    self.imgViewCollection = nil;
    self.labelPrice.text = [NSString stringWithFormat:@"订制价：%@",self.myCollectionModel.collectionPrice];
    self.labelHotSale.text = [NSString stringWithFormat:@"热销:%@件",self.myCollectionModel.collectionAmount];
    self.labelAuthorID.text = [NSString stringWithFormat:@"设计师ID：%@",self.myCollectionModel.collectionAuthorID];
    self.labelTitle.text = self.myCollectionModel.collectionTitle;
}
@end
